package com.demo2do.fms.admin.dto;

import java.math.BigDecimal;

/**
 * 
 * 其他费用信息，用于维护派车单
 * 
 * @author Ysy
 *
 */
public class OtherFeeInfo {

    private Long id;
    
    /** 费用名称 */
    private String feeName;
    
    private BigDecimal otherFee;
    
    private Boolean anjiSet;
    
    /** 派车单ID */
    private Long dispatchOrderId;
    
    /** 费用 */
    private BigDecimal fee;
    
    private BigDecimal anjiFee;
    
    /**
     * The default constructor
     */
    public OtherFeeInfo() {
        
    }
    
    /**
     * 
     * @param anjiSet
     * @param fee
     * @return
     */
    public OtherFeeInfo editAnjiFeeAndFee(Boolean anjiSet, BigDecimal fee){
        
        if(anjiSet == null)
            return this;
        
        if(anjiSet) {
            this.fee = new BigDecimal(0);
            this.anjiFee = fee;
        } else {
            this.fee = fee;
            this.anjiFee = new BigDecimal(0);
        }
        
        return this;
    }
    
    /**
     * 
     * @param anjiSet
     * @param fee
     * @return
     */
    public OtherFeeInfo editAnjiFeeOrFee(Boolean anjiSet, BigDecimal fee){
        
        if(anjiSet) {
            this.anjiFee = fee;
        } else {
            this.fee = fee;
        }
        
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the feeName
     */
    public String getFeeName() {
        return feeName;
    }

    /**
     * @return the otherFee
     */
    public BigDecimal getOtherFee() {
        return otherFee;
    }

    /**
     * @return the anjiSet
     */
    public Boolean getAnjiSet() {
        return anjiSet;
    }

    /**
     * @return the dispatchOrderId
     */
    public Long getDispatchOrderId() {
        return dispatchOrderId;
    }

    /**
     * @return the fee
     */
    public BigDecimal getFee() {
        return fee;
    }

    /**
     * @return the anjiFee
     */
    public BigDecimal getAnjiFee() {
        return anjiFee;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param feeName the feeName to set
     */
    public void setFeeName(String feeName) {
        this.feeName = feeName;
    }

    /**
     * @param otherFee the otherFee to set
     */
    public void setOtherFee(BigDecimal otherFee) {
        this.otherFee = otherFee;
    }
    
    public void setAnjiSet(BigDecimal anjiSet) {
        
        this.anjiSet = anjiSet == null ? null : anjiSet.equals(BigDecimal.ZERO) ? false :true;
    }
 
    /**
     * @param dispatchOrderId the dispatchOrderId to set
     */
    public void setDispatchOrderId(Long dispatchOrderId) {
        this.dispatchOrderId = dispatchOrderId;
    }

    /**
     * @param fee the fee to set
     */
    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }

    /**
     * @param anjiFee the anjiFee to set
     */
    public void setAnjiFee(BigDecimal anjiFee) {
        this.anjiFee = anjiFee;
    }
}
